package com.ruoyi.tea.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.tea.domain.TeaRecoring;
import com.ruoyi.tea.domain.TeaUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tea.mapper.TeaFollowRecoringMapper;
import com.ruoyi.tea.domain.TeaFollowRecoring;
import com.ruoyi.tea.service.ITeaFollowRecoringService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户关注主播记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-07-31
 */
@Service
public class TeaFollowRecoringServiceImpl implements ITeaFollowRecoringService 
{
    @Autowired
    private TeaFollowRecoringMapper teaFollowRecoringMapper;

    /**
     * 查询用户关注主播记录
     * 
     * @param id 用户关注主播记录主键
     * @return 用户关注主播记录
     */
    @Override
    public TeaFollowRecoring selectTeaFollowRecoringById(Long id)
    {
        return teaFollowRecoringMapper.selectTeaFollowRecoringById(id);
    }

    /**
     * 查询用户关注主播记录列表
     * 
     * @param teaFollowRecoring 用户关注主播记录
     * @return 用户关注主播记录
     */
    @Override
    public List<TeaFollowRecoring> selectTeaFollowRecoringList(TeaFollowRecoring teaFollowRecoring)
    {
        return teaFollowRecoringMapper.selectTeaFollowRecoringList(teaFollowRecoring);
    }

    @Override
    public List<TeaRecoring> selectTeaFollowRecoringApiList(TeaFollowRecoring teaFollowRecoring) {
        return teaFollowRecoringMapper.selectTeaFollowRecoringApiList(teaFollowRecoring);
    }

    /**
     * 新增用户关注主播记录
     * 
     * @param teaFollowRecoring 用户关注主播记录
     * @return 结果
     */
    @Override
    public int insertTeaFollowRecoring(TeaFollowRecoring teaFollowRecoring)
    {
        teaFollowRecoring.setCreateTime(DateUtils.getNowDate());
        return teaFollowRecoringMapper.insertTeaFollowRecoring(teaFollowRecoring);
    }

    /**
     * 修改用户关注主播记录
     * 
     * @param teaFollowRecoring 用户关注主播记录
     * @return 结果
     */
    @Override
    public int updateTeaFollowRecoring(TeaFollowRecoring teaFollowRecoring)
    {
        return teaFollowRecoringMapper.updateTeaFollowRecoring(teaFollowRecoring);
    }

    /**
     * 批量删除用户关注主播记录
     * 
     * @param ids 需要删除的用户关注主播记录主键
     * @return 结果
     */
    @Override
    public int deleteTeaFollowRecoringByIds(String ids)
    {
        return teaFollowRecoringMapper.deleteTeaFollowRecoringByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户关注主播记录信息
     * 
     * @param id 用户关注主播记录主键
     * @return 结果
     */
    @Override
    public int deleteTeaFollowRecoringById(Long id)
    {
        return teaFollowRecoringMapper.deleteTeaFollowRecoringById(id);
    }

    /**
     * 个人收藏数量
     * @param teaUser
     * @return
     */
    @Override
    public int followNumber(TeaUser teaUser) {
        return teaFollowRecoringMapper.followNumber(teaUser);
    }
}
